﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;
using Sunny.UI;

namespace LaneLpnr
{

    public partial class FMain : UIHeaderAsideMainFrame
    {

        /// <summary>
        /// 主方法
        /// </summary>

        public FMain()
        {
            InitializeComponent();
           this.WindowState = FormWindowState.Maximized;

            MainControl_Init();
        }

        /// <summary>
        /// 
        /// </summary>
        public void MainControl_Init()
        {
            int pageIndex = 1000;
            //Header.SetNodePageIndex(Header.Nodes[0], pageIndex);//这是和右上角节点绑定
            //Header.SetNodeSymbol(Header.Nodes[0], 61451);
            TreeNode parent = Aside.CreateNode("车道视频", 61451, 24, pageIndex);
            Aside.CreateChildNode(parent, AddPage(new Forms.车道视频监控(), ++pageIndex));

            //示例设置某个节点的小红点提示
            Aside.ShowTips = true;
          

            pageIndex = 2000;
            //Header.SetNodePageIndex(Header.Nodes[1], pageIndex);
            //Header.SetNodeSymbol(Header.Nodes[1], 61818);
            //parent = Aside.CreateNode("窗体", 61818, 24, pageIndex);
            //Aside.CreateChildNode(parent, AddPage(new Forms.车道视频监控(), Guid.NewGuid()));//可以增加多个界面

            pageIndex = 3000;
            //Header.SetNodePageIndex(Header.Nodes[2], pageIndex);
            //Header.SetNodeSymbol(Header.Nodes[2], 61950);
            //parent = Aside.CreateNode("图表", 61950, 24, pageIndex);


            //选中第一个节点
            Aside.SelectPage(1001);


        }

        private void FMain_Load(object sender, EventArgs e)
        {
            FlashLog.FlashLogger.Instance().Register();//注册log4net实例
        }


        private void FMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            FlashLog.FlashLogger.Instance().AbortThread(); //关闭log4
        }


        private void FMain_SizeChanged(object sender, EventArgs e)
        {

        }


    }
}
